package com.lizhi.rpc.controller;

import com.lizhi.rpc.handler.RecvPrescriptionInfoHandler;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: lizhi
 * @Description:
 * @Date: create in 2020/7/14 17:10
 */
@Slf4j
@RestController
@RequestMapping(value = "/api/rpc/prescriptionInfo")
@Api("处方信息上传")
public class RecvPrescriptionInfoController {

    @Resource
    private RecvPrescriptionInfoHandler recvPrescriptionInfoHandler;

    @ApiOperation("接收同步的处方信息数据")
    @ApiImplicitParam(name = "json", value = "处方信息数据", required = true, dataType = "String", paramType = "query")
    @PostMapping(path = "/recvPrescription")
    public String recvPrescriptionInfo(@RequestBody String json){
        return recvPrescriptionInfoHandler.recvPrescriptionInfo(json);
    }
}
